﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="F600_Du_an.aspx.cs" Inherits="DanhMuc_F600_Du_an" %>
<%@ Register assembly="eWorld.UI" namespace="eWorld.UI" tagprefix="ew" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<table cellspacing="0" cellpadding="2" style="width:100%;" class="cssTable" border="0">
<!-- Lọc dữ liệu dự án -->
    <tr>
		    <td class="cssPageTitleBG" colspan="5">
		        <asp:label id="lbl_Nhan_loc_du_an" runat="server" CssClass="cssPageTitle" Text="Lọc dữ liệu dự án "/>
		    </td>
	</tr>
	    <tr>
		    <td align="right">
			    <asp:label id="m_lbl_ma_du_an_s" CssClass="cssManField" runat="server" 
                    Text="Mã dự án"/>
		    </td>
		    <td>
			   <asp:textbox id="m_txt_ma_du_an_s" CssClass="cssTextBox"  runat="server" 
                    MaxLength="64" Width="96%" />
		    </td>
            <td align="right">
                    <asp:label id="m_lbl_trang_thai_du_an" CssClass="cssManField" runat="server" 
                Text="Trạng thái dự án" />
		            </td>
                <td align="left" colspan="2">
                    <asp:DropDownList id="m_cbo_trang_thai_du_an_s" runat="server" 
                        CssClass="cssDorpdownlist"  >
                    </asp:DropDownList>
                    </td>
		</tr>
        <tr>
            <td align="right">
                    <asp:label id="m_lbl_tu_khoa_tim_kiem" CssClass="cssManField" runat="server" 
                Text="Từ khóa tìm kiếm" />
		            </td>
            <td>  <asp:TextBox ID="m_txt_tu_khoa_tim_kiem" runat="server"  Width="96%" CssClass="cssTextBox"></asp:TextBox></td>
             <td align="left" colspan="2">
                      <asp:label id="m_lbl_tu_khoa" CssClass="cssLabel" runat="server" 
                Text="(Từ khóa tìm kiếm: Tên dự án, tên khách hàng, trạng thái dự án ...)"/>
             </td>
        </tr>
        <tr>
            <td colspan="4" align="center">
            <asp:button id="m_cmd_xem_toan_bo" CssClass="cssButton" runat="server" 
                Width="98px" Text="Xem toàn bộ" Height="22px" CausesValidation="false" onclick="m_cmd_xem_toan_bo_Click" 
             />&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
               <asp:button id="m_cmd_loc_du_lieu" CssClass="cssButton" runat="server" 
                Width="98px" Text="Lọc dữ liệu" Height="22px" CausesValidation="false" onclick="m_cmd_loc_du_lieu_Click" 
             /> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
            <asp:button id="m_cmd_them_moi_s"  CssClass="cssButton" runat="server" 
                    Width="98px" Text="Thêm mới" Height="22px"  CausesValidation="false"
                    onclick="m_cmdbtn_them_moi_s_Click" />   
                <asp:HiddenField ID="m_hdf_id_dm_du_an" runat="server" Visible="False" />
            </td>
        </tr>
<!-- Cập nhật dự án , danh sách dự án-->
    <tr>
		    <td class="cssPageTitleBG" colspan="5">
		        <asp:label id="m_lbl_cap_nhat" runat="server" CssClass="cssPageTitle" Text="Kết quả lọc dữ liệu"/>
		    </td>
	</tr>
    <tr>
		    <td colspan="5" align="left">
		        <asp:ValidationSummary ID="m_vls_error_sumary" runat="server" />
                <asp:label id="m_lbl_thong_bao" runat="server" CssClass="cssThongBao"/>
		    </td>
	</tr>
    <!-- Danh sách dự án -->
    <tr>
		<td align="center" colspan="4">
            <asp:GridView ID="m_grv_ds_du_an" runat="server" AutoGenerateColumns="False" 
                Width="98%" BackColor="White" BorderColor="#999999" BorderStyle="None" 
                BorderWidth="1px" CellPadding="3" GridLines="Vertical" DataKeyNames="ID" 
                onrowupdating="m_grv_ds_du_an_RowUpdating" 
                onrowdeleting="m_grv_ds_du_an_RowDeleting">
                <AlternatingRowStyle BackColor="#DCDCDC" />
                <Columns>
                    <asp:TemplateField HeaderText="STT">
                        <ItemTemplate>
                            <%# Container.DataItemIndex +1 %>
                        </ItemTemplate>
                        <ItemStyle Height="10px"/>
                    </asp:TemplateField>
                    <asp:BoundField DataField="MA_DU_AN" HeaderText="Mã dự án" />
                    <asp:BoundField DataField="TEN_DU_AN" HeaderText="Tên dự án" />
                    <asp:TemplateField HeaderText="Loại dự án">
                        <ItemTemplate>
                            <%# mapping_loai_du_an_by_id(Eval("ID_LOAI_DU_AN"))%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="GIA_TRI_HOP_DONG" HeaderText="Giá trị HĐ" 
                        DataFormatString="{0:N0}" ItemStyle-HorizontalAlign="Right">
<ItemStyle HorizontalAlign="Right"></ItemStyle>
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Khách hàng">
                        <ItemTemplate>
                            <%# mapping_khach_hang_by_id(Eval("ID_KHACH_HANG")) %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Trạng thái">
                        <ItemTemplate>
                            <%# mapping_trang_thai_da_by_id(Eval("ID_TRANG_THAI_DU_AN")) %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Chi tiết">
                        <ItemTemplate>
                            <asp:LinkButton runat="server" ID="m_lbt_chi_tiet" CommandName="Update" ToolTip="Xem chi tiết" CausesValidation="false"><center><img src="../Images/info.png" width="20px" height="20px" alt="Sửa" /></center></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Xóa">
                         <ItemTemplate>
                            <asp:LinkButton runat="server" ID="m_lbt_xoa" CommandName="Delete" OnClientClick="return confirm ('Các dữ liệu liên quan cũng sẽ bị xóa. Bạn có thực sự muốn xóa ?')" ToolTip="Xóa dự án này" CausesValidation="false"><center><img src="../Images/del.png" width="20px" height="20px" alt="Xóa" /></center></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
             
                <SortedAscendingCellStyle BackColor="#F1F1F1" />
                <SortedAscendingHeaderStyle BackColor="#0000A9" />
                <SortedDescendingCellStyle BackColor="#CAC9C9" />
                <SortedDescendingHeaderStyle BackColor="#000065" />
             
            </asp:GridView>
        </td>
    </tr>

    <!-- Cập nhật dự án -->
     <tr>
        <td align="right">
             <asp:label id="m_lbl_ma_du_an" CssClass="cssManField" runat="server" Text="Mã dự án" Visible="false"/>
        </td>
        <td>
			    <asp:textbox id="m_txt_ma_du_an" CssClass="cssTextBox"  runat="server"  Width="85%" Visible="false"/>
                <asp:RequiredFieldValidator ID="m_rfv_ma_du_an" runat="server" 
                ControlToValidate="m_txt_ma_du_an" Text="(*)" ErrorMessage="Bạn phải nhập Mã dự án"></asp:RequiredFieldValidator>
		</td>
        <td colspan="2">
        </td>
    </tr>
     <tr>
        <td align="right" >
             <asp:label id="lbl_ten_da" CssClass="cssManField" runat="server" Text="Tên dự án" Visible="false"/>
        </td>
        <td>
			    <asp:textbox id="m_txt_ten_du_an" CssClass="cssTextBox"  runat="server" Width="85%" Visible="false"/>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                ControlToValidate="m_txt_ten_du_an" Text="(*)" ErrorMessage="Bạn phải nhập Tên dự án"></asp:RequiredFieldValidator>
		</td>
        <td align="right">
                    <asp:label id="lbl_loai_da" CssClass="cssManField" runat="server" 
                Text="Loại dự án" Visible="false"/>
		            </td>
                <td align="left" colspan="2">
                    <asp:DropDownList id="m_cbo_loai_du_an" runat="server" 
                        CssClass="cssDorpdownlist" Visible="false" >
                    </asp:DropDownList>
                    </td>
    </tr>
    <tr>
        <td align="right" >
             <asp:label id="lbl_ngay_ky_hd" CssClass="cssManField" runat="server" Text="Ngày ký hợp đồng" Visible="false"/>
        </td>
        <td>
            <ew:CalendarPopup ID="m_txt_ngay_ky_hd" runat="server" 
                        ControlDisplay="TextBoxImage" GoToTodayText="Hôm nay:" ImageUrl="~/Images/cal.gif"
                        Nullable="True" NullableLabelText="" 
                        ShowGoToToday="True" Width="50%" SelectedDate="" Text="" Culture="vi-VN" 
                        DisableTextboxEntry="False" Visible="false">
                        <weekdaystyle backcolor="White" font-names="Verdana,Helvetica,Tahoma,Arial" 
                            font-size="XX-Small" forecolor="Black" />
                        <weekendstyle backcolor="LightGray" font-names="Verdana,Helvetica,Tahoma,Arial" 
                            font-size="XX-Small" forecolor="Black" />
                        <offmonthstyle backcolor="AntiqueWhite" 
                            font-names="Verdana,Helvetica,Tahoma,Arial" font-size="XX-Small" 
                            forecolor="Gray" />
                        <selecteddatestyle backcolor="Yellow" 
                            font-names="Verdana,Helvetica,Tahoma,Arial" font-size="XX-Small" 
                            forecolor="Black" />
                        <monthheaderstyle backcolor="Yellow" 
                            font-names="Verdana,Helvetica,Tahoma,Arial" font-size="XX-Small" 
                            forecolor="Black" />
                        <DayHeaderStyle BackColor="Orange" Font-Names="Verdana,Helvetica,Tahoma,Arial" 
                            Font-Size="XX-Small" ForeColor="Black" />
                        <cleardatestyle backcolor="White" font-names="Verdana,Helvetica,Tahoma,Arial" 
                            font-size="XX-Small" forecolor="Black" />
                        <gototodaystyle backcolor="White" font-names="Verdana,Helvetica,Tahoma,Arial" 
                            font-size="XX-Small" forecolor="Black" />
                        <TodayDayStyle BackColor="LightGoldenrodYellow" 
                            Font-Names="Verdana,Helvetica,Tahoma,Arial" Font-Size="XX-Small" 
                            ForeColor="Black" />
                        <holidaystyle backcolor="White" font-names="Verdana,Helvetica,Tahoma,Arial" 
                            font-size="XX-Small" forecolor="Black" />
                    </ew:CalendarPopup>
        </td>
        <td align="right">
                    <asp:label id="lbl_trang_thai_da" CssClass="cssManField" runat="server" 
                Text="Trạng thái dự án" Visible="false" />
		            </td>
                <td align="left" colspan="2">
                    <asp:DropDownList id="m_cbo_trang_thai_du_an" runat="server" 
                        CssClass="cssDorpdownlist" Visible="false"  >
                    </asp:DropDownList>
                    </td>
    </tr>
    <tr>
        <td align="right" >
             <asp:label id="lbl_gia_tri_hd" CssClass="cssManField" runat="server" Text="Giá trị hợp đồng" Visible="false"/>
        </td>
        <td>
			    <asp:textbox id="m_txt_gia_tri_hop_dong" CssClass="cssTextBox"  runat="server"  Width="85%" Visible="false" />
                <asp:CompareValidator runat="server" id="compPrimeNumberPositive" Operator="GreaterThanEqual" Type="Currency"
                Display="Dynamic" ValueToCompare="0" ControlToValidate="m_txt_gia_tri_hop_dong" Text="(*)" ErrorMessage = "Giá trị hợp đồng nhập không đúng định dạng" />
		</td>
        <td align="right" >
             <asp:label id="lbl_gia_tri_thuc_nhan" CssClass="cssManField" runat="server" Text="Giá trị thực nhận" Visible="false"/>
        </td>
        <td>
			     <asp:textbox id="m_txt_gia_tri_thuc_nhan" CssClass="cssTextBox"  runat="server"  Width="85%"  Visible="false"/>
                  <asp:CompareValidator runat="server" id="CompareValidator1" Operator="GreaterThanEqual" Type="Currency"
                Display="Dynamic" ValueToCompare="0" ControlToValidate="m_txt_gia_tri_thuc_nhan" Text="(*)" ErrorMessage = "Giá trị thực nhận nhập không đúng định dạng" />

		</td>
    </tr>
     <tr>
        <td align="right">
             <asp:label id="lbl_khach_hang" CssClass="cssManField" runat="server" Text="Khách hàng" Visible="false"/>
        </td>
        <td>
			<asp:DropDownList id="m_cbo_khach_hang" runat="server" 
                        CssClass="cssDorpdownlist" Visible="false" >
                    </asp:DropDownList>
		</td>
        <td align="right">
             <asp:label id="lbl_thue" CssClass="cssManField" runat="server" Text="Thuế (VAT 10%)" Visible="false"/>
        </td>
        <td>
			 <asp:RadioButtonList ID="m_rdl_tax" runat="server" RepeatDirection="Horizontal" Width="167px" Visible="false">
                <asp:ListItem Value="Y" Selected="True">Có</asp:ListItem>
                <asp:ListItem Value="N">Không</asp:ListItem>
            </asp:RadioButtonList>
		</td>
    </tr>
    <tr>
        <td align="right" >
             <asp:label id="lbl_ghi_chu" CssClass="cssManField" runat="server" Text="Ghi chú" Visible="false"/>
        </td>
        <td colspan="3">
			    <asp:textbox id="m_txt_ghi_chu" CssClass="cssTextBox"  runat="server"  Width="98%" TextMode="MultiLine" Visible="false"/>
		</td>
    </tr>
    <tr>
            <td colspan="4" align="center">
            <asp:button id="m_cmd_them" CssClass="cssButton" runat="server" 
                Width="98px" Text="Thêm" Height="22px" Visible="false"
                    onclick="m_cmd_them_Click"/>
               <asp:button id="m_cmd_xoa_trang" CssClass="cssButton" runat="server" 
                Width="98px" Text="Xóa trắng" Height="22px" Visible="false" CausesValidation="false"
                    onclick="m_cmd_xoa_trang_Click"/>
                <asp:button id="m_cmd_cap_nhat" CssClass="cssButton" runat="server"
                Width="98px" Text="Cập nhật" Height="22px" Visible="false" 
                    onclick="m_cmd_cap_nhat_Click"/>
                <asp:button id="m_cmd_sua_thong_tin_du_an" CssClass="cssButton" runat="server" CausesValidation="false"
                Width="98px" Text="Sửa thông tin" Height="22px" Visible="false" 
                    onclick="m_cmd_sua_thong_tin_du_an_Click" />
               <asp:button id="m_cmd_huy" CssClass="cssButton" runat="server" CausesValidation="false"
                Width="98px" Text="Hủy" Height="22px" Visible="false" 
                    onclick="m_cmd_huy_Click" />
               <asp:button id="m_cmd_xuat_excel" CssClass="cssButton" runat="server" CausesValidation="false"
                Width="98px" Text="Xuất Excel" Height="22px" Visible="true" 
                    onclick="m_cmd_xuat_excel_Click"/>
            </td>
        </tr>
</table>
</asp:Content>

